/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.dp.vo;

import java.io.Serializable;
import java.util.Set;

import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.apache.struts2.json.annotations.JSON;

/**
 *
 * @author wyr
 */
@Entity
@Table(name = "news_extends_channel")
//@NamedQueries({@NamedQuery(name = "NewsExtendsChannel.findAll", query = "SELECT n FROM NewsExtendsChannel n"), @NamedQuery(name = "NewsExtendsChannel.findByChannleid", query = "SELECT n FROM NewsExtendsChannel n WHERE n.channleid = :channleid"), @NamedQuery(name = "NewsExtendsChannel.findByIconid", query = "SELECT n FROM NewsExtendsChannel n WHERE n.iconid = :iconid"), @NamedQuery(name = "NewsExtendsChannel.findByNote", query = "SELECT n FROM NewsExtendsChannel n WHERE n.note = :note"), @NamedQuery(name = "NewsExtendsChannel.findByUpdatetimer", query = "SELECT n FROM NewsExtendsChannel n WHERE n.updatetimer = :updatetimer")})
public class NewsExtendsChannel implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "channleid")
    private Integer channleid;
    @Column(name = "iconid")
    private Integer iconid;
    @Column(name = "note")
    private String note;
    @Column(name = "updatetimer")
    private String updatetimer;
    @JoinColumn(name = "channel_id", referencedColumnName = "channel_id")
    @ManyToOne
    private TChannels channelId;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "newsExtendsChannel")
    private Set<NewsExtendsChannelAds> newsExtendsChannelAdsSet;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "newsExtendsChannel")
    private Set<NewsExtendsChannelTitle> newsExtendsChannelTitleSet;
    @OneToMany(mappedBy = "channleid")
    private Set<NewsQuestion> newsQuestionSet;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "newsExtendsChannel")
    private Set<NewsExtendsFirstchannelChannels> newsExtendsFirstchannelChannelsSet;

    public NewsExtendsChannel() {
    }

    public NewsExtendsChannel(Integer channleid) {
        this.channleid = channleid;
    }

    public Integer getChannleid() {
        return channleid;
    }

    public void setChannleid(Integer channleid) {
        this.channleid = channleid;
    }

    public Integer getIconid() {
        return iconid;
    }

    public void setIconid(Integer iconid) {
        this.iconid = iconid;
    }

    public String getNote() {
        return note;
    }

    public void setNote(String note) {
        this.note = note;
    }

    public String getUpdatetimer() {
        return updatetimer;
    }

    public void setUpdatetimer(String updatetimer) {
        this.updatetimer = updatetimer;
    }

    public TChannels getChannelId() {
        return channelId;
    }

    public void setChannelId(TChannels channelId) {
        this.channelId = channelId;
    }

    @JSON(serialize=false)
    public Set<NewsExtendsChannelAds> getNewsExtendsChannelAdsSet() {
        return newsExtendsChannelAdsSet;
    }

    public void setNewsExtendsChannelAdsSet(Set<NewsExtendsChannelAds> newsExtendsChannelAdsSet) {
        this.newsExtendsChannelAdsSet = newsExtendsChannelAdsSet;
    }

    @JSON(serialize=false)
    public Set<NewsExtendsChannelTitle> getNewsExtendsChannelTitleSet() {
        return newsExtendsChannelTitleSet;
    }

    public void setNewsExtendsChannelTitleSet(Set<NewsExtendsChannelTitle> newsExtendsChannelTitleSet) {
        this.newsExtendsChannelTitleSet = newsExtendsChannelTitleSet;
    }

    @JSON(serialize=false)
    public Set<NewsQuestion> getNewsQuestionSet() {
        return newsQuestionSet;
    }

    public void setNewsQuestionSet(Set<NewsQuestion> newsQuestionSet) {
        this.newsQuestionSet = newsQuestionSet;
    }

    @JSON(serialize=false)
    public Set<NewsExtendsFirstchannelChannels> getNewsExtendsFirstchannelChannelsSet() {
        return newsExtendsFirstchannelChannelsSet;
    }

    public void setNewsExtendsFirstchannelChannelsSet(Set<NewsExtendsFirstchannelChannels> newsExtendsFirstchannelChannelsSet) {
        this.newsExtendsFirstchannelChannelsSet = newsExtendsFirstchannelChannelsSet;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (channleid != null ? channleid.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof NewsExtendsChannel)) {
            return false;
        }
        NewsExtendsChannel other = (NewsExtendsChannel) object;
        if ((this.channleid == null && other.channleid != null) || (this.channleid != null && !this.channleid.equals(other.channleid))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.dp.vo.NewsExtendsChannel[channleid=" + channleid + "]";
    }

}
